<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
     var arr = [1, 1, 2, 3, 4, 4, 2, 1, 3, 5]
   
   function norepeat(e) {
    
    for(i=0;i<e.length;i++){
e[i]
for(j=0;j<e.length;j++){
    if(e[i]===e[j]&&i!==j){
e.splice(j,1)
    }
}
    }
    console.log(e)
   }
   norepeat(arr)
 // [1, 2, 3, 4, 5]
</script>
</html>